//1.带参数的函数
function sum(){
	//判断是否为数字
	if(/[0-9]/.test(num1)){
		num1 = Number(num1);
	}else{
		alert("请输入数字");
	}
	if(/[0-9]/.test(num2)){
		num2 = Number(num2);
	}else{
		alert("请输入数字");
	}
	document.write(num1+"+"+num2+"=" + (num1+num2));
	// console.log("a+b="+(a+b));
}